-- skeleton
-- created by panyl
-- 骷髅

return {
    apply = function(prop, baseValue)
        local v = math.modf(baseValue * tonumber(prop[3]) / 1000);

        return prop[3];
    end,

    clear = function(who, prop)
        -- 重新刷一下属性
        PropM.refresh(who);

        -- 刷新下光环属性
        AssistMonsterM.updateAssistData();

        -- 更新守卫格子状态
        if who.type == OBJECT_TYPE_MONSTER then
            EventMgr.fire(event.GRID_LOCK_STATE, {["pos"] = who:getPos(), });
        end

        if who.type == OBJECT_TYPE_GHOST_SHIP or who.type == OBJECT_TYPE_MONSTER then
            -- 怪物还原模型
            EventMgr.fire(event.GRID_ORI_MODEL, {["pos"] = who:getPos(),});
        end
    end,

    record = function(target, prop, path)
        if target.type == OBJECT_TYPE_MONSTER and not target:isDead() then
            -- 怪物才变骷髅
            local dbase = MonsterM.query(target.classId, "dbase") or {};
            local changeClassId = 4;

            if target:isSlime() or dbase["slime_display"] == 1 then
                -- 冈布奥怪特殊处理
                changeClassId = 6;
            end

            target.dbase:set("changeClassId", changeClassId);
        end
        return false;
    end
};
